<!DOCTYPE html>
<html>
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../back-common.jsp"%>
<%@ include file="/WEB-INF/pages/common/taglib.jsp"%>
<%@ include file="/WEB-INF/pages/common/layui.jsp"%>
<head>
  <meta charset="utf-8">
  <title>目标列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  
  <link href="<ls:templateResource item='/resources/plugins/taskdashboard/css/bootstrap.min.css?v=3.3.6'/>" rel="stylesheet">
  <link href="<ls:templateResource item='/resources/plugins/taskdashboard/css/style.css?v=4.1.0'/>" rel="stylesheet">
  
  <link href="<ls:templateResource item='/resources/plugins/select2-4.0/select2.css'/>" rel="stylesheet"/>
  
  <script src="<ls:templateResource item='/resources/plugins/taskdashboard/js/jquery-ui-1.10.4.min.js'/>" type="text/javascript"></script>
  
  <script type='text/javascript' src="<ls:templateResource item='/resources/common/js/jquery.serialize-object.min.js'/>" /></script>
  <script src="<ls:templateResource item='/resources/plugins/select2-4.0/select2.full.min.js'/>" type="text/javascript"></script>
  <script src="<ls:templateResource item='/resources/plugins/select2-4.0/i18n/zh-CN.js'/>" type="text/javascript"></script>
  <script src="<ls:templateResource item='/resources/plugins/select2-4.0/makeSelect2.js'/>" type="text/javascript"></script>
</head>
<body> 
   <table class="${tableclass}" style="width: 100%">
	   <tr><th>
	          <strong class="am-text-primary am-text-lg"><a href="<ls:url address='/admin/project/query'/>">项目管理</a></strong> /  目标看板 - ${project.name}
	    	</th>
	    </tr>
	</table>   
		    
  <div style="margin-left: 0.5rem">
    <div class="seller_list_title">
        <ul class="seller_title_ul am-tabs-nav am-nav am-nav-tabs">
            <li><i></i><a href="<ls:url address="/admin/project/load/${project.id}"/>">项目信息</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectPlan/query/${project.id}"/>">里程碑</a></li>
            <li class="am-active"><i></i><a href="<ls:url address="/admin/task/query/${project.id}"/>">目标</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectModule/query/${project.id}"/>">模块</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectMember/query/${project.id}"/>">团队</a></li>
            <li><i></i><a href="<ls:url address="/admin/projectReport/query/${project.id}"/>">报表</a></li>
        </ul>
    </div>
  </div>  
  
  <form id="form1">
        <table class="${tableclass}" style="min-width: 1000px;margin-bottom: 0;">
		    <tbody><tr><td>
		    	    <div align="left" style="padding: 3px;float: left;display:inline-block;width: 100%; overflow: auto;">
				    <select name="assignedto" id="assignedto" style="width: 120px">
				    	<option value="">选择指派给</option>
					   	<c:if test="${not empty taskQueryDto.assignedto}">
					   	  <option value="${taskQueryDto.assignedto}" selected="selected">${taskQueryDto.assignedtoRealName}</option>
					   	</c:if>
				   </select>
				   
				   <select name="createBy" id="createBy" style="width: 120px">
				    <option value="">选择由谁建立</option>
				   	<c:if test="${not empty taskQueryDto.createBy}">
				   	  <option value="${taskQueryDto.createBy}" selected="selected">${taskQueryDto.createByRealName}</option>
				   	</c:if>
				   </select>	
				   
				    <select name="finishedby" id="finishedby" style="width: 120px">
				    <option value="">选择由谁完成</option>
				   	<c:if test="${not empty taskQueryDto.finishedby}">
				   	  <option value="${taskQueryDto.finishedby}" selected="selected">${taskQueryDto.finishedbyRealName}</option>
				   	</c:if>
				   </select>
				
				    <select name="canceledby" id="canceledby" style="width: 120px">
				    <option value="">选择由谁取消</option>
				   	<c:if test="${not empty taskQueryDto.canceledby}">
				   	  <option value="${taskQueryDto.canceledby}" selected="selected">${taskQueryDto.canceledbyRealName}</option>
				   	</c:if>
				   </select>   
				   
				    <select name="closedby" id="closedby" style="width: 120px">
				    <option value="">选择由谁关闭</option>
				   	<c:if test="${not empty taskQueryDto.closedby}">
				   	  <option value="${taskQueryDto.closedby}" selected="selected">${taskQueryDto.closedbyRealName}</option>
				   	</c:if>
				   </select> 
				   	<input type="button" value="搜索" onclick="javascript:sendData();"  data-type="reload" class="criteria-btn"/>
					<input type="button" value="创建" class="criteria-btn" onclick='window.location="<ls:url address='/admin/task/loadByProject/${project.id}'/>"'/>
				   </div>
		     </td></tr></tbody>
	    </table>
    </form>

     <div id="dashboardList"></div>

<script language="JavaScript" type="text/javascript">
$(document).ready(function () {
	 sendData();
   	 makeSelect2(contextPath + "/admin/adminUser/userListInTeam/${project.id}","#assignedto","指派给","value","key");
   	 makeSelect2(contextPath + "/admin/adminUser/userListInTeam/${project.id}","#createBy","由谁建立","value","key");
   	 makeSelect2(contextPath + "/admin/adminUser/userListInTeam/${project.id}","#finishedby","由谁完成","value","key");  
   	 makeSelect2(contextPath + "/admin/adminUser/userListInTeam/${project.id}","#canceledby","由谁取消","value","key"); 
   	 makeSelect2(contextPath + "/admin/adminUser/userListInTeam/${project.id}","#closedby","由谁关闭","value","key"); 
});

function sendData(){
	var formData = $("#form1").serialize();
     $.ajax({
    		url:"${contextPath}/admin/task/dashboardTask/${project.id}", 
    		type:'post', 
    		data:formData,
    		async : true, //默认为true 异步   
    		error: function(jqXHR, textStatus, errorThrown) {
    		 //  alert("系统异常" + " jqXHR= " + jqXHR + ", textStatus = " + textStatus + ",errorThrown =  " + errorThrown);
    		},
    		success:function(result){
    		   $("#dashboardList").html(result);
    		}
    	});
}
</script>
</body>
</html>